import request from '@/utils/request'

const RoleApi = {
  listPaged: (queryParams) => request.get('/roles/page', { params: queryParams }),

  getInfo: (roleId) => request.get(`/roles/${roleId}/form`),

  add: (roleDto) => request.post('/roles', roleDto),

  edit: (roleDto) => request.put('/roles', roleDto),

  del: (ids, force) => request.delete(`/roles/${ids}`, {
    params: {
      force
    }
  }),

  assignMenus: (roleId, menuIds) => request.put(`/roles/${roleId}/menus`, menuIds),

  getRoleMenuIds: (roleId) => request.get(`/roles/${roleId}/menuIds`)
}

export default RoleApi
